package com.nb.hdj.testCase.configurationModule;

import com.nb.hdj.data.HtConfigurationEnum;
import com.nb.hdj.model.ConfigurationManagement;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 * @Description: 内容发布频道子菜单
 * @Author: hedongjia
 * @Date: 2021/12/23 上午11:09
 * @Version: v1.0
 */
public class ContentPublishCase extends ConfigurationCaseBase {
    /**
     * 查看内容发布频道
     * @param driver
     * @return
     */
    public boolean viewContentPublish(WebDriver driver) {
        try {
            //点击配置管理
            seleniumUtil.elementClick(driver,By.xpath(HtConfigurationEnum.CONFIGURATION_Management_Menu_Element.getValue()));
            seleniumUtil.sleep(1500);
            //调用配置管理模块 查看方法
            return viewBase(driver, HtConfigurationEnum.CONFIGURATION_Content_Publish_Element.getValue(),
                    HtConfigurationEnum.CONFIGURATION_Content_First_Name_Element.getValue());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return false;
    }

    /**
     * 新增内容发布频道
     * @param driver
     * @return
     */
    public boolean insertContent(WebDriver driver){
        cm.setClassName("测试课程发布").setSortNumber("1");
        return insertBase(driver,cm);
    }

    public boolean updateContent(WebDriver driver){
        cm.setClassName("更改课程发布");
        return updateBase(driver,cm);
    }

    public boolean deleteContent(WebDriver driver){
        seleniumUtil.sleep(1000);
        return deleteBase(driver,cm);
    }







}
